package request

import (
	"github.com/gin-gonic/gin"
	"strconv"
)

var (
	defaultStart = 0
	defaultOffset = 20
)


func GetLimit(c *gin.Context)(start,offset int){
	start,serr := strconv.Atoi(c.Query("start"))
	offset,oerr := strconv.Atoi(c.Query("offset"))
	if serr != nil || oerr != nil  || start < 0 {
		start = defaultStart
		offset = defaultOffset
	}
	return
}
